/* @(#)GSLoginAction.java    
*
* Project: BUS
*
* Modify Information:
* =============================================================================
*   Author       Date       Description
*   ------------ ---------- ---------------------------------------------------
*   Simonyi Peng 2006-2-7    建立
*
* Copyright Notice:
* =============================================================================
*    Copyright (c) 2001-2006 Beijing HiTRUST Technology Co., Ltd. 1808 Room, 
*        Science & Technology Building, No. 9 South Street, Zhong Guan Cun, 
*        Haidian District, Beijing ,100081, China All rights reserved.
*
*    This software is the confidential and proprietary information of
*        Beijing HiTRUST Technology Co., Ltd. ("Confidential Information").
*        You shall not disclose such Confidential Information and shall use it
*        only in accordance with the terms of the license agreement you entered
*        into with HiTRUST.
*
* Warning:
* =============================================================================
* 
*/
package com.hitrust.gs.action;

import java.util.ArrayList;
import java.util.HashMap;

import org.apache.commons.beanutils.BeanUtils;

import com.hitrust.gs.bean.GSOperatorBean;
import com.hitrust.gs.bean.GSPayReceiveMentBean;
import com.hitrust.gs.dao.GSOrderDeptInfoDAO;
import com.hitrust.gs.form.GSPayReceiveAlertQueryForm;
import com.hitrust.gs.form.GSPayReceiveStatusQueryForm;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.lib.GSLogWriter;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
import com.hitrust.gs.service.GSBaseManager;
import com.hitrust.gs.util.exception.*;
import com.hitrust.gs.util.lang.StringUtils;
import com.hitrust.gs.util.page.ResultProcess;
import com.hitrust.gs.vo.GSManufactureVO;
import com.hitrust.gs.vo.GSPayReceiveAbleStatusListVO;
import com.hitrust.gs.vo.GSPayReceiveAlertQueryVO;
import com.hitrust.gs.vo.GSPayReceiveStatusQueryVO;
import com.hitrust.gs.business.GSBusOrgProcessor;
import com.hitrust.gs.business.GSManufactureProcessor;
import com.hitrust.gs.business.GSPayReceiveProcessor;


public class GSPayReceiveStatusDetailAction extends GSBaseAction {
	public String execute(GSBaseForm aForm) throws GSException {
	    
	    GSOperatorBean operatorBean = (GSOperatorBean)aForm.getSession().getAttribute(GSBaseConstants.LOGIN);
        GSPayReceiveProcessor proc = new GSPayReceiveProcessor();
	        
        String buffer = aForm.getRequest().getParameter("payreceivementId");
        String workcorpId = buffer.substring(0,buffer.indexOf(","));
        String payTime = buffer.substring(buffer.indexOf(",")+1);
        
        try{
		    GSPayReceiveMentBean tBean = proc.getPayReceiveMentBean(workcorpId,payTime);
		    ArrayList alertList = proc.getPayReceiveAbleListByPayReceiveMent(tBean);
		    double strikeNum = 0;
		    for(int i=0;i<alertList.size();i++){
		        GSPayReceiveAbleStatusListVO bean = (GSPayReceiveAbleStatusListVO)alertList.get(i);
		        strikeNum += Double.parseDouble(bean.paynum);
		    }

		    aForm.getRequest().setAttribute("alertlist",alertList);
		    aForm.getRequest().setAttribute("bean",tBean);
		    aForm.getRequest().setAttribute("strikenum",new Double(strikeNum));
            
        }catch(Exception ex){
	        GSLogWriter.error(this,ex.toString());
	        aForm.getRequest().setAttribute("action","A180601.do");
	        aForm.getRequest().setAttribute("window","true");
	        throw new GSException(GSException.E20080,GSException.E20080_MSG);
	    }
        
        return GSBaseConstants.FORWARD_SUCCESS;
        
	}
	

}
